package org.jeecg.modules.demo.shopprojectcart.cart.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.shopprojectcart.entity.ShopProjectCart;
import org.jeecg.modules.demo.shopprojectcart.mapper.ShopProjectCartMapper;
import org.jeecg.modules.demo.shopprojectcart.service.IShopProjectCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description: 项目购物车
 * @Author: jeecg-boot
 * @Date: 2022-01-14
 * @Version: V1.0
 */
@Service
public class ShopProjectCartServiceImpl extends ServiceImpl<ShopProjectCartMapper, ShopProjectCart> implements IShopProjectCartService {
    @Autowired
    private ShopProjectCartMapper shopProjectCartMapper;

    // 项目数量加1
    @Override
    public void addQty(String id) {
        shopProjectCartMapper.addQty(id);
    }

    // 项目数量减1
    @Override
    public void reduceQty(String id) {
        shopProjectCartMapper.reduceQty(id);
    }

    // 项目数量修改
    @Override
    public void updateQty(String id, Integer qty) {
        shopProjectCartMapper.updateQty(id, qty);
    }

    // 查询购物车项目列表
    @Override
    public List<Map<String, Object>> getListByMemberId(Integer pageNo, Integer pageSize, String storeId, String memberId) {
        return shopProjectCartMapper.getListByMemberId(pageNo - 1, pageSize, storeId, memberId);
    }
}
